<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
	<head>
		<title>tab auto onmouseover</title>
		
		<style>
			.x{
				display:inline;
				background-color:gray;
				color:red;
				height:200px;
				padding:100px;
			}
		</style>
		
		
	</head>
	
	<body>

		<div id="sb" class="x">
			xxxxx
		</div>
		
		<script>
			function sb(){
					var sb = document.getElementById("sb");							
					sb.style.backgroundColor = "green";
					
			
			}
			
		
			
			function addEvent(el, type, fn) {
				if(window.addEventListener) {
					el.addEventListener(type, fn, false);
				}else if(window.attachEvent) {
					el.attachEvent('on' + type, fn);
				}
			}
			

			(function(){
			
				var s = document.getElementById("sb");
				addEvent(s, "mouseover", sb);
			
			
			} )();
        
		</script>
	</body>

</html>